package com.zrh.jsd.service.studydemo.daemon_thread;

public class TestDaemonThread {
    public static void main(String[] args) {

        Thread thread1 = new Thread(()->{
            for (int i = 0; i < 50; i++) {
                try {
                    Thread.sleep(1000);
                    System.out.println("thread1==="+i);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
//        thread1.setDaemon(true);
        thread1.start();

        Thread thread2 = new Thread(()->{
            for (int i = 0; i < 50; i++) {
                try {
                    Thread.sleep(10);
                    System.out.println("thread2==="+i);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        thread2.start();
    }
}
